import { SET_APP_STATE, ON_TAB_SELECT, FETCH_APP_DATA, GET_SHOWCASE_DATA } from '../../constants/ActionType';
import * as APIS from '../../constants/APIS';
import { fetchPOST, fetchGET } from '../../utils/index';
var path = require('path');

export const setState = (value) => { return dispatch => dispatch({ type: SET_APP_STATE, payload: value }) };
export function onTabSelect(key) {
    return dispatch => dispatch({
        type: ON_TAB_SELECT,
        payload: { key: key }
    })
};
export function fetchAppData() {
    return dispatch => {
        fetch(APIS.IS_GET_APP_DATA).then((res) => {
            dispatch({ type: FETCH_APP_DATA, payload: {} })

        })
    }

}
export function fetchShowCaseData() {
    return dispatch => {
        fetchGET(APIS.IS_GET_SHOWCASE_DATA).then((res) => {
            console.log('showcaseData', res.data);
            dispatch({ type: GET_SHOWCASE_DATA, payload: res.data })
        })
    }
}
